using System;
using System.Xml;
using System.Linq;
using System.Text;
using System.Diagnostics;
using System.Collections.Generic;


/* Generated with http://xmltocs.com/ */
namespace MVCGeneratorXMLXML
{
    public class Column
    {
        // Attributes
        public String FieldName { get; set; }
        public String DataType { get; set; }
        public String ShowInMasterView { get; set; }
        public String ShowInDetailView { get; set; }
        public String IsSearchable { get; set; }
        public String ComboBoxColumn { get; set; }
        public String Key { get; set; }
        public String DisplayField { get; set; }

        public Column()
        {
            FieldName = "";
            DataType = "";
            ShowInMasterView = "";
            ShowInDetailView = "";
            IsSearchable = "";
            ComboBoxColumn = "";
            Key = "";
            DisplayField = "";
        }

        public static Column CreateNewColumn(System.Xml.XmlNode Node)
        {
            Column NewColumn = new Column();

            foreach (XmlAttribute Attribute in Node.Attributes)
            {
                switch (Attribute.Name)
                {
                    case "FieldName":
                        NewColumn.FieldName = Attribute.Value;
                        break;
                    case "DataType":
                        NewColumn.DataType = Attribute.Value;
                        break;
                    case "ShowInMasterView":
                        NewColumn.ShowInMasterView = Attribute.Value;
                        break;
                    case "ShowInDetailView":
                        NewColumn.ShowInDetailView = Attribute.Value;
                        break;
                    case "IsSearchable":
                        NewColumn.IsSearchable = Attribute.Value;
                        break;
                    case "ComboBoxColumn":
                        NewColumn.ComboBoxColumn = Attribute.Value;
                        break;
                    case "Key":
                        NewColumn.Key = Attribute.Value;
                        break;
                    case "DisplayField":
                        NewColumn.DisplayField = Attribute.Value;
                        break;
                    default:
                        break;
                }
            }

            foreach (XmlNode ChildNode in Node.ChildNodes)
            {
                switch (ChildNode.Name)
                {
                    default:
                        break;
                }
            }

            return NewColumn;
        }
    }
}
